package example.string;

/**
 * Created by lenovo on 2016/11/4 0004.
 *  substring() 函数来删除字符串中的一个字符
 */
public class DeleteString {
    public static void main(String[] args){
        String str = "this is Java";
        System.out.println(removeCharAt(str,3));
    }

    private static String removeCharAt(String str, int i) {
        //str.substring(index);得到的是（index,str.length()-1);的字符串
        return str.substring(0,i) + str.substring(i+1);
    }
}
